import pinia from "@/store";
import useUserStore from "@/store/modules/user";
export function isHasButton(app: any) {
    const userStore = useUserStore(pinia);
    // 全局自定义指令，实现按钮的权限
    console.log(app, 'wr');
    app.directive('has', {
        mounted(el: any, option: any) {
            console.log(userStore.buttons);
            if (!userStore.buttons.includes(option.value)) {
                el.parentNode.removeChild(el); //移除子节点
            }
        }
    })
}